package com.csust.automaticteach.service;

import com.csust.automaticteach.exception.BusinessException;
import com.csust.automaticteach.exception.ErrorCode;
import com.csust.automaticteach.utils.ModelsUtils;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.Map;
import java.util.Set;

/**
 * 基础服务类
 */
@Service
public class BaseService {

	public Set<Map<String, String>> getDashScope() {

		Set<Map<String, String>> resultSet;

		try {
			resultSet = ModelsUtils.getDashScopeModels();
		}
		catch (IOException e) {
			throw new BusinessException(ErrorCode.PARAMS_ERROR,"Get DashScope Model failed, " + e.getMessage());
		}

		return resultSet;
	}

}